<%@ page import="dao.ImplementNote" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="pojo.Note" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<style>
    .title_left{
        margin-left: 420px;
    }
    .content_left{
        border:1px solid black;
        width: 440px;
        margin-left: 420px;
        height: 100px;
        margin-bottom: 20px;
    }
    .back{
        margin-left: 800px;
    }
    .type{
        margin-left: 420px;
    }
    .delete{
        margin-left: 790px;
    }
    .end{
        margin-left: 740px;
    }
</style>
<script>
    function deleteNote(id){
        //给用户是否删除的安全提示，弹出提示框
        if(confirm("您确定删除吗？")){
            //访问该路径,但是id无法获取
            <%--location.href="${pageContext.request.contextPath}/deleteNoteServlet?id=${note.id}";--%>
            location.href="${pageContext.request.contextPath}/deleteareaNoteServlet?id="+id;
        }
    }
</script>
<body>
<%
    String usename=request.getParameter("usename");
    ImplementNote implementNote=new ImplementNote();
    ArrayList<Note> areausernote=new ArrayList<Note>();
    areausernote=implementNote.userallnote(usename);
    request.setAttribute("areauserote",areausernote);
//    要给要给！！！
%>
<c:forEach items="${areausernote}" var="note" varStatus="s">
    <form>
        <table>
            <tr>
                <td>
                    <h5 class="title_left">${note.title}</h5>
                    <h5 class="type">${note.type}</h5>
                    <a href="javascript:deleteNote(${note.id});" class="delete" type="submit">删除</a>
                    <p class="content_left">${note.content}</p>
                </td>
            </tr>
        </table>
    </form>


</c:forEach>
</body>
</html>
